<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		function run2(){
			var uname = document.getElementById("uname");
			uname.innerHTML = "请输入用户名";
		}

		function run(){
			var uname = document.getElementById("uname");
			var username = document.getElementById("username");
			if (username.value == "哈哈") {
				uname.innerHTML = "<font color='red'>用户名已存在</font>";
			}else{
				uname.innerHTML = "";
			}
			
		}
	</script>
</head>
<body>
	用户名:<input type="text" id="username" name="username" onfocus="run2()" onblur="run()" /><span id="uname"></span><br/>
	密码:<input type="password" id="pwd" name="pwd"><span id="upwd"></span>
</body>
</html>